﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LaneLpnr.Led
{
    class TFIInit
    {
        //0x0000ff  蓝色
        //0xff0000  红色
        //0xffff00  黄色
        //0x00ff00  青色
        //0xff00ff 粉红色
        //0x00ffff 浅蓝色
        public static uint ColorBlue = 0x0000ff;//红色
        public static uint ColorRed = 0xff0000;//蓝色
        public static uint ColorYellow = 0xffff00;
        public static uint ColorCyan = 0x00ff00;//绿色
        public static uint ColorPink = 0xff00ff;//粉色
        public static uint ColorWatherYellow = 0x00ffff;//浅黄色
        public static uint ColorWatherBlue = 0x00f0ff00;//浅蓝色

        public static int FirstLineNum = 1;
        public static int SencondLineNum = 2;
        public static int ThreeLineNum = 3;
        public static int FourLineNum = 4;
        //1居中对齐，两头多出的字砍掉，少的字两端补空白。 
        //2右对齐，左边多出的字砍掉，少的字补空白。 
        //3 由右向左边滚动到最左边:第一个字碰到左边界停止。 
        //4 由左向右边滚动到最右边:最后一个字碰到右边界停止。 
        //5 由右向左边滚动循环:最后一个字消失后，又重头开始 
        //6由左向右边滚动循环:第一个字消失后，又重头开始返回值：

        public static int RollModeCenter = 1;
        public static int RollModeRight = 2;
        public static int RollModeRollRight = 3;
        public static int RollModeRollLeft = 4;
        public static int RollModeRollRightOver = 5;
        public static int RollModeRollLeftOver = 6;

        //nRollSpeed 滚动速度。适用于显示模式第 5，6 两种。
        //这两个模 式允许文字总长度大于可显示宽度。数值越大滚动 速度越快（取值范围 0-3）。 
        public static int RollSpeedZero = 0;
        public static int RollSpeedOne = 1;
        public static int RollSpeedTwo = 2;
        public static int RollSpeedThree = 3;


        public static void LedWelcomeInit()
        {
            try
            {
                Led.TFIProgram.TFI_SendLine(Forms.车道视频监控.WelcomeLedIphwnd, FirstLineNum, ColorWatherBlue, RollModeCenter, RollSpeedTwo, Common.ConfigHelper.GetConnectionStringConfig("Welcome1"));
                Led.TFIProgram.TFI_SendLine(Forms.车道视频监控.WelcomeLedIphwnd, SencondLineNum, ColorWatherBlue, RollModeCenter, RollSpeedTwo, Common.ConfigHelper.GetConnectionStringConfig("Welcome2"));
                Led.TFIProgram.TFI_SendLine(Forms.车道视频监控.WelcomeLedIphwnd, ThreeLineNum, ColorWatherBlue, RollModeCenter, RollSpeedTwo, Common.ConfigHelper.GetConnectionStringConfig("Welcome3"));
                Led.TFIProgram.TFI_SendLine(Forms.车道视频监控.WelcomeLedIphwnd, FourLineNum, ColorWatherBlue, RollModeCenter, RollSpeedTwo, Common.ConfigHelper.GetConnectionStringConfig("Welcome4"));
            }
            catch (Exception ex)
            {
                FlashLog.FlashLogger.Error("Exception LedWelcomeInit "+ex.ToString());
            }

            }

    }
}
